package com.qf.cx.simplenms.persist.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qf.cx.simplenms.persist.dao.api.SubscriberDao;
import com.qf.cx.simplenms.persist.entity.SubscriberEntity;
import com.qf.cx.simplenms.persist.service.api.SubscriberService;

@Service
@Transactional(value = "hibernateTransactionManager")
public class SubscriberServiceImpl implements SubscriberService {
	@Autowired
	private SubscriberDao subscriberDao;

	@Override
	public void addSubscriber(SubscriberEntity subscriber) {
		subscriberDao.addSubscriber(subscriber);
	}

	@Override
	public void deleteSubscriber(long id) {
		subscriberDao.deleteSubscriber(id);
	}

	@Override
	public void updateSubscriber(SubscriberEntity subscriber) {
		subscriberDao.updateSubscriber(subscriber);
	}

	@Override
	public SubscriberEntity getSubscriber(long id) {
		return subscriberDao.getSubscriber(id);
	}

	@Override
	public List<SubscriberEntity> getSubscribers() {
		List<SubscriberEntity> list = subscriberDao.getSubscribers();
		return list;
	}

	@Override
	public void addSubscribers(List<SubscriberEntity> subscribers) {
		subscriberDao.addSubscriber(subscribers);
	}

}
